<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Zend Gdata API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link><script type="text/javascript" src="js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="js/jquery.cookie.js"></script><script type="text/javascript" src="js/jquery.treeview.js"></script><script type="text/javascript">
            $(document).ready(function() {
                $(".filetree").treeview({
                    collapsed: true,
                    persist: "cookie"
                });

                $("#accordion").accordion({
                    collapsible: true,
                    autoHeight:  false,
                    fillSpace:   true
                });

                $(".tabs").tabs();
            });
        </script></head><body><div xmlns="" class="content">
<div class="sub-page-main-header-api-documentation"><h2>API Documentation</h2></div>
<div class="dotted-line"></div>
</div>
<div xmlns="" id="content">
<script type="text/javascript" src="js/menu.js"></script><script>
      $(document).ready(function() {
        $('a.gripper').click(function() {
            $(this).nextAll('div.code-tabs').slideToggle();
            $(this).children('img').toggle();
            return false;
        });
        $('div.code-tabs').hide();
        $('a.gripper').show();
        $('div.file-nav').show();
      });
    </script><h1 class="file">Gdata/HttpAdapterStreamingProxy.php</h1>
<div class="file-nav"><ul id="file-nav">
<li><a href="#top">Global</a></li>
<li>
<a href="#classes"><img src="images/icons/class.png" height="14">
                      Classes
                  </a><ul><li><a href="#%5CZend_Gdata_HttpAdapterStreamingProxy">\Zend_Gdata_HttpAdapterStreamingProxy</a></li></ul>
</li>
</ul></div>
<a name="top"></a><div id="file-description">
<p class="short-description">Zend Framework</p>
<div class="long-description"><p>LICENSE</p>

<p>This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.</p>
</div>
</div>
<dl class="file-info">
<dt>category</dt>
<dd>Zend
         
    </dd>
<dt>copyright</dt>
<dd>Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
         
    </dd>
<dt>license</dt>
<dd>
<a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
         
    </dd>
<dt>package</dt>
<dd>Zend_Gdata
         
    </dd>
<dt>subpackage</dt>
<dd>Gdata
         
    </dd>
<dt>version</dt>
<dd>$Id: HttpAdapterStreamingProxy.php 23775 2011-03-01 17:25:24Z ralph $
         
    </dd>
</dl>
<a name="classes"></a><a id="\Zend_Gdata_HttpAdapterStreamingProxy"></a><h2 class="class">\Zend_Gdata_HttpAdapterStreamingProxy<div class="to-top"><a href="#top">jump to top</a></div>
</h2>
<div class="class">
<p class="short-description">Extends the proxy HTTP adapter to handle streams instead of discrete body
strings.</p>
<div class="long-description"><p>Should be used if proxy HTTP access is required. If no proxy is set, will
fall back to Zend_Http_Client_Adapter_Socket behavior. Just like the
default Socket adapter, this adapter does not require any special extensions
installed.</p>
</div>
<dl class="class-info">
<dt>Extends from</dt>
<dd><a href="db_Http_Client_Adapter_Proxy.html#%5CZend_Http_Client_Adapter_Proxy">\Zend_Http_Client_Adapter_Proxy</a></dd>
<dt>category</dt>
<dd>Zend
         
    </dd>
<dt>copyright</dt>
<dd>Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
         
    </dd>
<dt>license</dt>
<dd>
<a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
         
    </dd>
<dt>package</dt>
<dd>Zend_Gdata
         
    </dd>
<dt>subpackage</dt>
<dd>Gdata
         
    </dd>
</dl>
<h3>Constants</h3>
<div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::CHUNK_SIZE"></a><div class="constant">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/constant.png" alt="Constant">integer 
                <span class="highlight">CHUNK_SIZE</span>
                = '1024'
            </code><div class="description"><p class="short-description">The amount read from a stream source at a time.</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<dl class="constant-info">
<dt></dt>
<dd>integer<br><em></em>
</dd>
</dl>
</div>
<div class="clear"></div>
</div>
</div>
<h3>Methods</h3>
<div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::__construct()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">__construct</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Adapter constructor, currently empty. Config is set using setConfig()</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::__construct()">\Zend_Http_Client_Adapter_Socket::__construct()</a></small>
</div>
<div class="code-tabs"><div class="long-description">
</div></div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::__destruct()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">__destruct</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Destructor: make sure the socket is disconnected</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Proxy.html#%5CZend_Http_Client_Adapter_Proxy::__destruct()">\Zend_Http_Client_Adapter_Proxy::__destruct()</a></small>
</div>
<div class="code-tabs"><div class="long-description"><p>If we are in persistent TCP mode, will not close the connection</p>
</div></div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::_checkSocketReadTimeout()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">_checkSocketReadTimeout</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Check if the socket has timed out - if so close connection and throw
an exception</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::_checkSocketReadTimeout()">\Zend_Http_Client_Adapter_Socket::_checkSocketReadTimeout()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Throws</strong><table class="argument-info">
<thead><tr>
<th>Exception</th>
<th>Description</th>
</tr></thead>
<tr>
<td><a href="db_Http_Client_Adapter_Exception.html#%5CZend_Http_Client_Adapter_Exception">\Zend_Http_Client_Adapter_Exception</a></td>
<td><em>with READ_TIMEOUT code</em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::close()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">close</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Close the connection to the server</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Proxy.html#%5CZend_Http_Client_Adapter_Proxy::close()">\Zend_Http_Client_Adapter_Proxy::close()</a></small>
</div>
<div class="code-tabs"><div class="long-description">
</div></div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::connect()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">connect</span><span class="nb-faded-text">(
          string $host, int $port
              =
              80, boolean $secure
              =
              false
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Connect to the remote server</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Proxy.html#%5CZend_Http_Client_Adapter_Proxy::connect()">\Zend_Http_Client_Adapter_Proxy::connect()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>Will try to connect to the proxy server. If no proxy was set, will
fall back to the target server (behave like regular Socket adapter)</p>
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$host</th>
<td>string</td>
<td><em></em></td>
</tr>
<tr>
<th>$port</th>
<td>int</td>
<td><em></em></td>
</tr>
<tr>
<th>$secure</th>
<td>boolean</td>
<td><em></em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::connectHandshake()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">connectHandshake</span><span class="nb-faded-text">(
          string $host, integer $port
              =
              443, string $http_ver
              =
              1.1, array $headers
              =
              array
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Preform handshaking with HTTPS proxy using CONNECT method</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Proxy.html#%5CZend_Http_Client_Adapter_Proxy::connectHandshake()">\Zend_Http_Client_Adapter_Proxy::connectHandshake()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$host</th>
<td>string</td>
<td><em></em></td>
</tr>
<tr>
<th>$port</th>
<td>integer</td>
<td><em></em></td>
</tr>
<tr>
<th>$http_ver</th>
<td>string</td>
<td><em></em></td>
</tr>
<tr>
<th>$headers</th>
<td>array</td>
<td><em></em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::getConfig()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">getConfig</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          array</code><div class="description">
<p class="short_description">Retrieve the array of all configuration options</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::getConfig()">\Zend_Http_Client_Adapter_Socket::getConfig()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>array</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::getStreamContext()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">getStreamContext</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          resource</code><div class="description">
<p class="short_description">Get the stream context for the TCP connection to the server.</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::getStreamContext()">\Zend_Http_Client_Adapter_Socket::getStreamContext()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>If no stream context is set, will create a default one.</p>
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>resource</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::read()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">read</span><span class="nb-faded-text">(
          
          )
        </span>
        :
          string</code><div class="description">
<p class="short_description">Read response from server</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::read()">\Zend_Http_Client_Adapter_Socket::read()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::setConfig()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">setConfig</span><span class="nb-faded-text">(
          \Zend_Config $config
              =
              array
          )
        </span>
        :
          void</code><div class="description">
<p class="short_description">Set the configuration array for the adapter</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::setConfig()">\Zend_Http_Client_Adapter_Socket::setConfig()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$config</th>
<td>\Zend_Config</td>
<td><em><p>| array $config</p>
</em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::setOutputStream()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">setOutputStream</span><span class="nb-faded-text">(
          resource $stream
          )
        </span>
        :
          <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket">\Zend_Http_Client_Adapter_Socket</a></code><div class="description">
<p class="short_description">Set output stream for the response</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::setOutputStream()">\Zend_Http_Client_Adapter_Socket::setOutputStream()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>This function sets output stream where the result will be stored.</p>
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$stream</th>
<td>resource</td>
<td><em></em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td><a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket">\Zend_Http_Client_Adapter_Socket</a></td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::setStreamContext()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">setStreamContext</span><span class="nb-faded-text">(
          mixed $context
          )
        </span>
        :
          <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket">\Zend_Http_Client_Adapter_Socket</a></code><div class="description">
<p class="short_description">Set the stream context for the TCP connection to the server</p>
<small>Inherited from:
                    <a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket::setStreamContext()">\Zend_Http_Client_Adapter_Socket::setStreamContext()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>Can accept either a pre-existing stream context resource, or an array
of stream options, similar to the options array passed to the
stream_context_create() PHP function. In such case a new stream context
will be created using the passed options.</p>
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$context</th>
<td>mixed</td>
<td><em>Stream context or array of context options</em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td><a href="db_Http_Client_Adapter_Socket.html#%5CZend_Http_Client_Adapter_Socket">\Zend_Http_Client_Adapter_Socket</a></td>
<td></td>
</tr>
</table>
<strong>Details</strong><dl class="function-info">
<dt>since</dt>
<dd>Zend Framework 1.9
         
    </dd>
</dl>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_Gdata_HttpAdapterStreamingProxy::write()"></a><div class="method">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">write</span><span class="nb-faded-text">(
          string $method, <a href="db_Uri_Http.html#%5CZend_Uri_Http">\Zend_Uri_Http</a> $uri, string $http_ver
              =
              1.1, array $headers
              =
              array, string $body
          )
        </span>
        :
          string</code><div class="description"><p class="short_description">Send request to the proxy server with streaming support</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$method</th>
<td>string</td>
<td><em></em></td>
</tr>
<tr>
<th>$uri</th>
<td><a href="db_Uri_Http.html#%5CZend_Uri_Http">\Zend_Uri_Http</a></td>
<td><em></em></td>
</tr>
<tr>
<th>$http_ver</th>
<td>string</td>
<td><em></em></td>
</tr>
<tr>
<th>$headers</th>
<td>array</td>
<td><em></em></td>
</tr>
<tr>
<th>$body</th>
<td>string</td>
<td><em></em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td>Request as string</td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<small xmlns="" class="footer">Documentation was generated by <a href="http://docblox-project.org">DocBlox 0.13.3</a>.
    </small></body></html>
